|
![](/i/fill.gif) |
Thorsten Froehlich wrote:
>
> In article <383ADE3C.61F2BC9E@buckosoft.com> , Dick Balaska
> <dic### [at] buckosoft com> wrote:
>
> > So if your code is using floats,
> ...
>
> That is wrong! There is no time for conversion required, as it is a trivial
> to "cut off" the exponent (reduce it from 11 to 8 bit) and the significant
> (reducing it from 52 to 23 bit) when loading/storing them.
> As a matter of fact, internally all current processors store floating-point
> numbers as if they were doubles (or whatever other most precise internal
> format they support). When performing the calculation as single-precision,
> the other bits are just not taken into account.
It is a little more curious still. You can force an Intel FPU to work
in several precision modes (32, 64, 80). There are differences in the
total # of clocks from beginning to end based on how much data needs to
be pushed onto the FPU stack and the precision you run the FPU.
A secondary consideration is that with the tiny on chip cache of the
Intel chips, using larger data sizes (8 byte doubles) will cause misses
more often than using 4 byte singles. When this happens you get a huge
performance hit.
Understanding and programming around these types of things is very
important to games programmers and real time sim packages. It is also
quite platform dependent.
Xander
Post a reply to this message
|
![](/i/fill.gif) |